rm(list = ls())
library(ggplot2)
# t分布
ggplot() + xlim(-5,5) + geom_function(fun = dt, args = list(df = 2)) +
  geom_function(fun = dt, args = list(df = 30), linetype = 2) +
  geom_function(fun = dnorm, color = 'red') + labs(y = '') +
  theme_bw()
ggsave('../tdesen.png')

# chi 分布
ggplot() + xlim(0,50) + geom_function(fun = dchisq, args = list(df = 2), color = I('red')) +
  geom_function(fun = dchisq, args = list(df = 4)) +
  geom_function(fun = dchisq, args = list(df = 10), linetype = 3) +
  geom_function(fun = dchisq, args = list(df = 30), linetype = 2) +
  labs(y = '') + theme_bw()
ggsave('../chidesen.png')

# F分布
ggplot() + xlim(0,5) + geom_function(fun = df, args = list(df1 = 2, df2 = 2), color = I('red')) +
  geom_function(fun = df, args = list(df1 = 20, df2 = 20)) +
  geom_function(fun = df, args = list(df1 = 60, df2 = 40), linetype = 2) +
  # geom_function(fun = dchisq, args = list(df = 30), linetype = 2) +
  labs(y = '') + theme_bw()
ggsave('../fdesen.png')
